<?php

/**
 * @author Marc André Audet <root@manhim.net>
 * @copyright Copyright(c) 2009-2010 Marc André Audet
 * @version 2.0.5.23
 * @license http://www.gnu.org/licenses/gpl.txt The GNU General Public License version 3
 *
 *   Manhim's Object Oriented framework
 *   Version consist of:
 *   [Major Version].[Number of years since 2010].[Month].[Date]
 *   The informations are based on the latest edit of this file, not the whole project.
 *
 *   Copyright (C) 2009-2010 Marc André Audet
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
if (!defined('IN_MANHIM_FRAMEWORK')) exit();

/* An abstract class for the framework's modules. It is a required
 * lass for the whole framework to work correctly. */

abstract class Framework_Modules
{

    private $_Args = array();
    private $_Modules = array();
    private $_LockArgs = false;
    private $_LockModules = false;

    public function SetArgs($args)
    {
        if ((is_array($args) || $args !== null) && $this->_LockArgs != true)
        {
            $this->_Args = $args;
            $this->_LockArgs = true;
        }
    }

    protected function GetArgs()
    {
        return $this->_Args;
    }

    public function SetModules(&$modules)
    {
        if ($modules !== null && $this->_LockModules != true)
        {
            $this->_Modules = &$modules;
            $this->_LockModules = true;
        }
    }

    private $_IsMainModule = false;
    private $_LockIsMainModule = false;

    protected function SetIsMainModule($isMainModule)
    {
        if (is_bool($isMainModule))
        {
            $this->_IsMainModule = $isMainModule;
            $this->_LockIsMainModule = true;
        }
    }

    public function GetIsMainModule()
    {
        return $this->_IsMainModule;
    }

    function __get($member)
    {
        if ($member == 'Modules')
        {
            return $this->_Modules;
        }
        else
        {
            return null;
        }
    }

    function __set($member, $value)
    {
        return null;
    }

}

?>